//
// Created by shen on 2024/7/3.
//

#ifndef AUDIOCAMERA_TSQUEUE_H
#define AUDIOCAMERA_TSQUEUE_H
#include <TSPlayerStatus.h>
#include "queue"
extern "C"{
#include "libavcodec/avcodec.h"
};

class TSQueue {
public:
    std::queue<AVPacket *> queuePacket;

    pthread_mutex_t  mutePacket;

    pthread_cond_t condPacket;

    TSPlayerStatus *playstatus=NULL;
public:
    TSQueue(TSPlayerStatus *playerStatus);

    ~TSQueue();

    int putAvpacket(AVPacket *packet);


    int getAvpacket(AVPacket *packet);


    int getQueueSize();

    void clearAvpacket();

    void lock();

    void unlock();
};


#endif //AUDIOCAMERA_TSQUEUE_H
